<script setup lang="ts">
import { computed } from 'vue'

interface Props {
  title: string
  subtitle?: string
  icon?: any
  description?: string
}

const props = withDefaults(defineProps<Props>(), {
  subtitle: '관리 기능을 제공합니다',
  description: '이 페이지는 현재 개발 중입니다. 실제 기능은 추후 구현될 예정입니다.'
})

const iconComponent = computed(() => props.icon)
</script>

<template>
  <div class="placeholder-page">
    <div class="page-header">
      <div class="header-content">
        <el-icon v-if="iconComponent" class="page-icon" size="24">
          <component :is="iconComponent" />
        </el-icon>
        <div class="header-text">
          <h1 class="page-title">{{ title }}</h1>
          <p class="page-subtitle">{{ subtitle }}</p>
        </div>
      </div>
    </div>

    <div class="page-content">
      <!-- 占位内容 -->
      <div class="placeholder-content">
        <div class="placeholder-icon">
          <el-icon size="64" color="#C0C4CC">
            <component :is="iconComponent" v-if="iconComponent" />
            <el-icon v-else>📋</el-icon>
          </el-icon>
        </div>
        <div class="placeholder-text">
          <h3>{{ title }}</h3>
          <p>{{ description }}</p>
        </div>
      </div>

      <!-- 开发提示 -->
      <div class="placeholder-notice">
        <el-alert
          title="개발 중"
          :description="description"
          type="info"
          :closable="false"
          show-icon
        />
      </div>
    </div>
  </div>
</template>

<style scoped>
.placeholder-page {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.page-header {
  margin-bottom: 20px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-icon {
  color: var(--el-color-primary);
}

.header-text {
  flex: 1;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--el-text-color-primary);
  margin: 0 0 4px 0;
}

.page-subtitle {
  font-size: 14px;
  color: var(--el-text-color-regular);
  margin: 0;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.placeholder-icon {
  opacity: 0.6;
}

.placeholder-text h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--el-text-color-primary);
  margin: 0 0 8px 0;
}

.placeholder-text p {
  font-size: 14px;
  color: var(--el-text-color-regular);
  margin: 0;
  line-height: 1.5;
}

.placeholder-notice {
  width: 100%;
  max-width: 400px;
}
</style>
